// public


#include <iostream>
using namespace std;
#pragma pack(1)

class Human {
	public:
	private:
		int m_age;
		string m_name;
};

class Student : public Human {
	public:
	private:
		int m_no;
};

// designer
// ------------------------------------------------------------------
// user

int main( void ) { 
	Human h;
	cout << "sizeof( h ) : " << sizeof(h) << endl;

	Student s;
	cout << "sizeof( s ) : " << sizeof(s) << endl;

	Human* ph = &s;
	Human& rh = s;

//	Student* ps = static_cast<Student*>(&h);	// Danger
//	Student& rs = static_cast<Student&>(h);		// Danger

	Student* ps = static_cast<Student*>(ph);	// Safety
	Student& rs = static_cast<Student&>(rh);	// Safety

	return 0;
}

